/*    */ package com.cr.common.utils;
/*    */ 
/*    */ import java.io.PrintWriter;
/*    */ import java.io.StringWriter;
/*    */ import org.apache.commons.lang3.exception.ExceptionUtils;
/*    */ 
/*    */ public class ExceptionUtil {
/*    */   public static String getExceptionMessage(Throwable e) {
/* 19 */     StringWriter sw = new StringWriter();
/* 20 */     e.printStackTrace(new PrintWriter(sw, true));
/* 21 */     String str = sw.toString();
/* 22 */     return str;
/*    */   }
/*    */   
/*    */   public static String getRootErrorMessage(Exception e) {
/* 27 */     Throwable root = ExceptionUtils.getRootCause(e);
/* 28 */     root = (root == null) ? e : root;
/* 29 */     if (root == null)
/* 31 */       return ""; 
/* 33 */     String msg = root.getMessage();
/* 34 */     if (msg == null)
/* 36 */       return "null"; 
/* 38 */     return MyStringUtils.defaultString(msg);
/*    */   }
/*    */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\lib\creditorRights-common-4.7.0.jar!\com\cr\commo\\utils\ExceptionUtil.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */